<%@ include file="/WEB-INF/views/jsp/include/include.jsp"%>
<html>
<head>
<title>Hand In Hand</title>
<%@ include file="/WEB-INF/views/jsp/include/head.jsp"%>
</head>
<body>
	<%@ include file="/WEB-INF/views/jsp/include/header.jsp"%>
	<%@ include file="/WEB-INF/views/jsp/include/navigator.jsp"%>
	<%@ include file="/WEB-INF/views/jsp/include/errors.jsp"%>

	<div class="container-fluid">
		<div id="center" class="col-xs-6">
			<div id="membershipRequests">
				<br> <br>
				<header style="font-size: 16pt;"> Membership Requests:</header>
				<br>
				<c:if test="${not empty membershipRequestList}">
					<c:forEach var="membershipRequest" items="${membershipRequestList}">
		            	Request from: 
		            	<a class="list-group-item-warning"
							href="<spring:url value='/user/${membershipRequest.user.id}'></spring:url>">
							${membershipRequest.user.name} ${membershipRequest.user.surname}</a>
						<button class="btn btn-default" type="button"
							onclick="location.href='<spring:url value="/communities/${membershipRequest.community.id}/acceptmembership/${membershipRequest.user.id}"></spring:url>'">
							Accept Request</button>
						<button class="btn btn-default" type="button"
							onclick="location.href='<spring:url value="/communities/${membershipRequest.community.id}/rejectmembership/${membershipRequest.user.id}"></spring:url>'">
							Reject Request</button>
						<br>
						<br>
					</c:forEach>
				</c:if>
			</div>
		</div>
	</div>


	<%@ include file="/WEB-INF/views/jsp/include/footer.jsp"%>

</body>
</html>